<?php include '../../authorization_check.php' ?>
<?php include '../../checkPCVPCSecretary.php'; ?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9">
<title>View Student Details</title>
<SCRIPT TYPE="text/javascript" src= "../../commonutils/util/util.js"> </SCRIPT>
</head>
<style type="text/css">
th {text-align: right}
</style>
<body>

<?php include 'top.html'; ?>
<?php include 'notifier.php' ?>

<?php
if (isset($_POST["studentIDRadio"])){
	$studentID = $_POST["studentIDRadio"];
}
if (isset($_POST['btnSubmitID'])){
	$studentID = $_POST['textID'];
}

?>


<p>
<?php
require_once '../../commonutils/db/DBConnectionManager.php';

if (isset($_POST['btnSubmitID']) || isset($_POST["studentIDRadio"]))
{
	$sqlquery = "select * from student where studentID = ".$studentID ;
	/* // echo $sqlquery;  */
	$result = DBConnectionManager::query($sqlquery);
	$num_rows = mysql_num_rows($result);
	if($num_rows == 0){
		echo "<p>No matching records found </p>";
		echo "<p><a href=\"SearchStudent.php\"> Back to student search page </a></p>";
	}
	else{
		$row = mysql_fetch_assoc($result);
		echo "<table border=1 cellpadding=3>";
		echo "<tr>";
		echo "<th>STUDENT ID: </th>";
		echo "<td>".$row['studentID']." &nbsp; </td>";
		echo "</tr>";	
		echo "<tr>";
		echo "<th>LAST NAME: </th>";
		echo "<td>".$row['lastName']." &nbsp; </td>";
		echo "</tr>";
		echo "<tr>";
		echo "<th>FIRST NAME: </th>";
		echo "<td>".$row['firstName']." &nbsp; </td>";
		echo "</tr>";
		echo "<tr>";
		echo "<th>DATE OF BIRTH: </th>";
		echo "<td>".$row['birthDate']." &nbsp; </td>";
		echo "</tr>";
		echo "<tr>";
		echo "<th>PLACE OF BIRTH: </th>";
		echo "<td>".$row['birthPlace']." &nbsp; </td>";
		echo "</tr>";
		echo "<tr>";
		echo "<th>CITIZENSHIP NUMBER: </th>";
		echo "<td>".$row['TC_Kimlik']." &nbsp; </td>";
		echo "</tr>";
		echo "<tr>";
		echo "<th>ADDRESS: </th>";
		echo "<td>".$row['address']." &nbsp; </td>";
		echo "</tr>";
		echo "<tr>";
		echo "<th>HOME TEL: </th>";
		echo "<td>".$row['homeTel']." &nbsp; </td>";
		echo "</tr>";
		echo "<tr>";
		echo "<th>OFFICE TEL: </th>";
		echo "<td>".$row['officeTel']." &nbsp; </td>";
		echo "</tr>";
		echo "<tr>";
		echo "<th>MOBILE TEL: </th>";
		echo "<td>".$row['mobileTel']." &nbsp; </td>";
		echo "</tr>";
		echo "</table>";
	}
	
}

?>
</p>  

<?php include 'bottom.php' ?>

</body>

</html>
